SUBROUTINE TRIDAGX(CA,CB,CC,CR,CU)

IMPLICIT COMPLEX*16 (C)
IMPLICIT REAL*8 (A,B,D-H,O-Z)
PARAMETER(NX = 10001)
DOUBLE COMPLEX CGAM(NX),CR(NX),CU(NX),CA(NX),CB(NX),CC(NX)
 CBET = CB(1)
 CU(1) = CR(1) / CBET
 DO 110 J = 2, NX
  CGAM(J) = CC(J-1) / CBET
  CBET = CB(J) - CA(J) * CGAM(J)
  CU(J) = ( CR(J) - CA(J) * CU(J-1) ) / CBET
110   CONTINUE
 DO 120 J = NX - 1, 1, -1
  CU(J) = CU(J) - CGAM(J+1) * CU(J+1)
120   CONTINUE
RETURN
END
